<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/26
  Time: 14:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>pageContext01</title>
</head>
<body>
<%
//    获取request
    pageContext.getRequest();
//    获取response
    pageContext.getResponse();
//    获取session
    pageContext.getSession();
//    获取application
    pageContext.getServletContext();
//    获取out
    pageContext.getOut();
//    对比jsp页面中存放信息
    pageContext.setAttribute("userName","张三");
    request.setAttribute("userName","张三");
%>

<%=pageContext.getAttribute("userName")%>

<%
//    将请求跳转到另外一个新页面
//    新页面能否获取page范围内的信息
    request.getRequestDispatcher("pageContext01_01.jsp")
            .forward(request,response);
%>
</body>
</html>
